import {createRouter,createWebHistory} from "vue-router";
// 用于创建创建多个路由实例，可以管理多个路由对象

export default createRouter({
    // 路由模式
    history:createWebHistory(),
    // 管理路由
    routes: [
        {
            path: '/home',
            component:()=>import('@/pages/home/index.vue')
        },
        {
            path: '/hospital',
            component:()=>import('@/pages/hospital/index.vue'),
            redirect:'/hospital/register',
            children:[
                {
                    path:'register',
                    component:()=>import('@/pages/hospital/register/index.vue')
                },
                {
                    path:'detail',
                    component:()=>import('@/pages/hospital/detail/index.vue')
                },
                {
                    path:'notice',
                    component:()=>import('@/pages/hospital/notice/index.vue')
                },
                {
                    path:'close',
                    component:()=>import('@/pages/hospital/close/index.vue')
                },
                {
                    path:'search',
                    component:()=>import('@/pages/hospital/search/index.vue')
                },
            ]
        },
        {
            path: '/',
            redirect: '/home'
        }
    ],
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }

})
